package mhe.mgt.service;

import java.util.List;
import java.util.Map;

public interface GeneralService<T> {

	public void add(T entity);

	public void update(T entity);

	public T merge(T entity);

	public void delete(T entity);

	public List<T> list();
	
	public T find(long id);

	public List<T> list(String[] field, Object[] value, boolean andCompare, Map<String, Boolean> sortFields, int start,
			int length);

	public abstract Class<T> getEntityClass();

	public Object list(String[] field, Object[] value, boolean andCompare, Map<String, Boolean> sortFields, int start,
			int length, String loadField);

	public long count();

	public long count(String[] field, Object[] value, boolean andCompare, Map<String, Boolean> sortFields);

	public void executeSQLQuery(String sql, Object[] values);

	public List<?> executeQuery(String sql, Object[] values, int start, int length);
	
}
